package website.domain;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

@Api("评论实体类")
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "tb_comment",autoResultMap = true)
public class Comment {
    private Integer id;
    private Integer uid;
    private Integer rid;
    private Integer parentId;
    private Integer replyId;
    private String commentContent;
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    private Date createTime;
    private Integer deleted;

    @TableField(exist = false)
    private String nickname;
    @TableField(exist = false)
    private String avatar;
    @TableField(exist = false)
    private Integer replyCount;
    @TableField(exist = false)
    private List<Comment> replyCommentList;
    @ApiModelProperty("点击查看评论，点击收起评论")
    @TableField(exist = false)
    private boolean flag;
}
